<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<c:set value="${pageContext.request.contextPath }" var="cPath"></c:set>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<title>Insert title here</title>
</head>
<SCRIPT type="text/javascript">
<c:if test="${!empty msg}">
alert("${msg}");
</c:if>
</SCRIPT>
<body>
	<div id="board" align="center">
	<form action="${cPath }/boardqaList.do" id="searchForm">
	<div id="imgt">
	<img src="${cPath }/css/b4.png" width="35%" align="left"><br>
	</div>
		<TABLE >
			<thead>
				<tr>
					<th>글번호</th>
					<th>글제목</th>
					<th>작성자</th>
					<th>날짜</th>
				</tr>
			</thead>
			<TBODY>
				<c:url var="boardqaView" value="/boardqaView.do" />
				<c:forEach items="${formDTO.dataList }"  var="boardqa">
				<tr>
					<td width="8%">${boardqa.qa_no }</td>
					<td width="62%" id="left"><a href="${boardqaView}?qa_no=${boardqa.qa_no}" >
					<c:forEach begin="2" end="${boardqa.qa_depth }">&nbsp;&nbsp;</c:forEach> 
					<c:if test="${boardqa.qa_depth!=1 }" >->RE:</c:if> 
					${boardqa.qa_title }</a></td>
					<td width="10%">${boardqa.qa_writer }</td>
					<td width="20%">${boardqa.qa_date }</td>
				</tr>
				</c:forEach>
				
			</TBODY>
		</TABLE>
		</br></br>
					<select name="searchType">
						<option value="content">내용</option>
						<option value="title">제목</option>
						<option value="writer">작성자</option>					
					</select>
					<input type="text" name="searchWord" />
					<input type="submit" value="검색"/>
					<input type="hidden" name="currentPage" value="1"/>
					<input type="button" value="새글쓰기" onclick="window.location.href='${cPath}/boardqaForm.do'" />
				
		</form>
	<div id="pagingNew">
		${formDTO.pagingHTML }
	</div>
</div>
<SCRIPT type="text/javascript">
var form = document.getElementById("searchForm");
form.searchType.value="${param.searchType}";
form.searchWord.value="${param.searchWord}";
function goPage(currPage) {
	window.location.href="${cPath}/boardqaList.do?currentPage="+currPage;
}
</SCRIPT>
</body>
</html>